t='';
var images = "";
for(var n=0 ; n<document.images.length ; n++) {
	images += ' <a onclick="document.f.url.value=document.images[' + n + '].src; document.f.submit(); return false;"><img src="' + document.images[n].src + '" style="border: 1px solid;"></a> \n'
};

if(images != '') {
	<?PHP
	if ($_SERVER["HTTPS"]) { $http = "https://"; }
	else { $http = "http://"; }

	$post_location = $http . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . "/";

	print "var url = \"$post_location\"\n";
	?>
	//document.write('<html><head><title>IMAGES!!!</title></head><body><table border="1" cellpadding="5" cellspacing="0"><tr><td><form name="f" action="' + url + '" method="post"><input type="hidden" name="url" /></form>' + images + '</td></tr></table></body></html>');
	document.write('<html><head><title>IMAGES!!!</title></head><body><h2 style="text-align: center;">Images Found</h2><div><form name="f" action=' + url + ' method="post"><input type="hidden" name="url" /></form>' + images + '</div></body></html>');
	
	void(document.close()) 
} else {
	alert('There are no images to host on this page.');
};
